package cn.iocoder.yudao.module.system.dal.mysql.worksaleinventory;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.worksaleinventory.WorkSaleInventoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.worksaleinventory.vo.*;

/**
 * 销售入库 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface WorkSaleInventoryMapper extends BaseMapperX<WorkSaleInventoryDO> {

    default PageResult<WorkSaleInventoryDO> selectPage(WorkSaleInventoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WorkSaleInventoryDO>()
                .eqIfPresent(WorkSaleInventoryDO::getWorkId, reqVO.getWorkId())
                .eqIfPresent(WorkSaleInventoryDO::getQuantity, reqVO.getQuantity())
                .eqIfPresent(WorkSaleInventoryDO::getWeight, reqVO.getWeight())
                .betweenIfPresent(WorkSaleInventoryDO::getDate, reqVO.getDate())
                .betweenIfPresent(WorkSaleInventoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WorkSaleInventoryDO::getId));
    }

}